// !@#$McCaBe-InStRuMeNtAtIoN$#@!
// Instrumented with the McCabe Java Parser
// Version: 8.1.0.1 - 20110309
// Using Path Vector Instrumentation
// Date: Sun Apr 01 2012 20:43:30
package Service;

import java.util.Scanner;

import com.mccabe.*;


class InputManager_9d0c6b23f224969186b5ef83270e161a {
    static java.lang.Object info[];
    static {
        info = new java.lang.Object[2];
        info[0] = new Integer(-1);
        info[1] = new String("R:\\yu\\Concordia\\SOEN 344 Design II\\Term Assignment\\Code Repo\\trunk\\Iteration 3\\ERS\\src\\Service\\InputManager.java");
    }
}


public class InputManager 
{
	/**
	 * Forces the user to enter a number between the boundaries min and max, inclusively.
	 * Good to use in combination with menu offered by output manager.
	 * 
	 * @param iMin The lower bound
	 * @param iMax The upper bound
	 * @return
	 */
	public static int readInput(int iMin, int iMax)
	{
int _mcFreq_43b369d522b92f1b075ac57fef28ff81[] = new int[7];
PathVec_ERS_Iter3.enterMethod(InputManager_9d0c6b23f224969186b5ef83270e161a.info,0,_mcFreq_43b369d522b92f1b075ac57fef28ff81,0);

		String response = "";
		int choice = 0;
		boolean inputOk = false;
		Scanner kb = new Scanner(System.in);
		
		while (
PathVec_ERS_Iter3.decision(InputManager_9d0c6b23f224969186b5ef83270e161a.info,0,_mcFreq_43b369d522b92f1b075ac57fef28ff81,1,2,
PathVec_ERS_Iter3.testCondition(!inputOk
))
)
		{
			OutputManager.print("Enter your choice number between " + iMin + " and " + iMax + ": ");
			response = kb.nextLine();
			for (int i = iMin; 
PathVec_ERS_Iter3.decision(InputManager_9d0c6b23f224969186b5ef83270e161a.info,0,_mcFreq_43b369d522b92f1b075ac57fef28ff81,3,4,
PathVec_ERS_Iter3.testCondition(i <= iMax
))
; ++i)
			{
				if (
PathVec_ERS_Iter3.decision(InputManager_9d0c6b23f224969186b5ef83270e161a.info,0,_mcFreq_43b369d522b92f1b075ac57fef28ff81,5,6,
PathVec_ERS_Iter3.testCondition(String.format("%d", i).equals(response)
))
)
				{
					inputOk = true;
					choice = i;
					break;
				}
			}
		}
		return choice;
	}
}
